package com.github.limit.param;

import com.github.limit.advise.LimitAdvise;
import com.github.limit.util.ParamUtils;
import com.github.limit.util.ReflectUtil;
import org.aspectj.lang.JoinPoint;

import java.util.Map;

/**
 * @author: wangdejun
 * @create: 2019-10-21 14:00
 **/
public class AopParam implements IParam {
    /**
     * 获取token，可以自定义参数名
     *
     * @param name
     * @return
     */
    @Override
    public String getToken(String name) {
        JoinPoint joinPoint = LimitAdvise.getJoinPoint();
        return ParamUtils.parseExpression(name, joinPoint, String.class);
    }
}
